<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>GameChampion | game</title>

    <meta
      name="keywords"
      content="GameChampion, action games, action games free, action games online, action games in online, action games shooting, action games best"
    />
    <meta
      name="description"
      content="Play the Best Free Online games. Fighting games, racing games, shooting games, sports games, boys games, girls games, kids games, all these html5 games can be played on your mobile, pad and tablet directly without installation. Have fun! - GameChampion"
    />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="http://kufeient.com" />
    <meta property="og:site_name" content="GameChampion" />
    <meta
      property="og:title"
      content="GameChampion — Free Online Games to Play"
    />
    <meta property="og:description" content="Play The Best Free Online Games" />

    <link rel="icon" href="static/image/favicon.png" />
    <link rel="stylesheet" href="./static/css/base.css" />
    <link rel="stylesheet" href="./static/css/detail.css" />

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/jsrender@1.0.15/jsrender.min.js"></script>
  </head>

  <body>
    <div class="game">
      <div class="head" id="header"></div>

      <div class="game_detail _margin">
        <img
          src="./static/image/placeholder-img.png"
          class="game_detail_image gameImg"
        />
        <div style="margin-left: 10px">
          <div class="game_detail_name gameTitle"></div>
        </div>
      </div>

      <div class="game_button">
        <div class="game_button_playnow" style="background-color: #4376ad">
          <a href="#" id="gameLink">Play Now</a>
        </div>
      </div>

      <div class="_margin" style="margin-top: 20px">
        <div class="game_detail_desc_title">About this game</div>
        <div class="game_detail_desc_content_some gameDesc"></div>
      </div>
      <script>
        let params = new URLSearchParams(document.location.search);
        let id = params.get("id");

        $.ajax({
          url: `https://app.nocodb.com/api/v2/tables/mg01furv08tboqh/records/${id}`,
          type: "GET",
          dataType: "json",
          headers: {
            "xc-token": "dePwLQ88UMbt4O9ndpBSQ-6RUC_nIhhpPea_0kTR",
          },
          contentType: "application/json; charset=utf-8",
          success: function (gameData) {
            $(".gameTitle").text(gameData.name);
            $(".gameDesc").text(gameData.desc);
            $(".gameImg").prop("src", gameData.cover);
            // $("#gameLink").prop("href", 'h5game/' + gameData.name.replace(/\s*/g, "") + '/index.html');
            if (!gameData.link) {
              gameData.link =
                window.location.origin +
                "/h5game/" +
                gameData.name.replace(/\s*/g, "") +
                "/index.html";
            }
            $("#gameLink").prop(
              "href",
              `javascript:playGame("${gameData.link}");`
            );
          },
          error: function (error) {
            console.error(error);
          },
        });

        function playGame(link) {
          $("#iframe1").prop("src", link).show();
        }
      </script>
      <div id="gameIframe" style="position: fixed; z-index: 9999999999999">
        <iframe
          id="iframe1"
          frameborder="no"
          style="
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            height: 100%;
            width: 100%;
          "
        ></iframe>
      </div>
      <div style="order: 5" class="content">
        <div class="c-title">You May Also Like</div>
        <div class="desc1 line-2">
          The annual Paris Fashion Week event is about to begin. As a well-known
          fashion designer, you need to design more and more fashionable clothes
          and cut out basic styles. Apart from this year's fashion week, today's
          theme is Baby. So all clothes must be related to Baby. You can display
          the clothes you just cut in your closet, or you can sell them to
          customers in need, if you want to become a qualified tailor, don't
          miss this game!
        </div>
        <script>
          window.gamelistParam = "&where=(tag,anyof,Hot)";
        </script>
        <div class="also-like-list" id="gamelist"></div>
      </div>
      <footer id="footer"></footer>
    </div>
  </body>

  <script type="text/javascript" src="static/js/common.js"></script>
</html>
